<template>
  <div class="container">
    <iframe id="myIframe" src="https://www.bilibili.com/?sfrom=dtshare&ts=1617248417961" frameborder="0"></iframe>
  </div>
</template>

<script lang="ts" setup name="测试utils">
// utils
// import { processTasks } from '@/utils/xxx';
import exclusive from '@/utils/objectExclusive';

let iframe: any = null;
onMounted(() => {
  iframe = document.getElementById('myIframe');
  iframe!.addEventListener('load', resizeIframe);
});
function resizeIframe() {
  // 获取 iframe 内容的实际高度
  const contentHeight = iframe!.contentWindow.document.body.scrollHeight;
  // 将内容高度设置给 iframe
  iframe!.style.height = `${contentHeight}px`;
}
// 监听 iframe 加载完成事件
// console.log('xxx:', processTasks);
console.log('exclusive:', exclusive({ a: '1', b: '2' }, 'a'));
</script>

<style lang="scss" scoped>
.container {
  height: 100vh;
}

#myIframe {
  width: 100%;
  height: 100%;
  border: 0;
  box-sizing: border-box;
}
</style>
